import Opt from '@/components/dt/info/Opt.js'

class Column extends Opt {
  constructor() {
    super()
    this.build()
  }

  build() {
    this.createAll()
    this.opts.push(...this.all)
  }

  createAll() {
    this.all = [
      {
        field: 'orgName',
        title: '所属组织',
        minWidth: 160
      },
      {
        field: 'housesName',
        title: '案场名称',
        minWidth: 180
      },
      {
        field: 'buildingId',
        title: '项目ID',
        minWidth: 100
      },
      {
        field: 'cooperationMode',
        title: '合作模式',
        minWidth: 160,
        header: {
          filter: {
            title: '合作模式',
            placeholder: '全部',
            key: 'cooperationModes',
            select: {
              key: 'cooperationModeAttrSort',
              clearable: true
            }
          }
        }
      },
      {
        field: 'beforeCommercePoints',
        title: '原商务基础点数',
        minWidth: 140
      },
      {
        field: 'afterCommercePoints',
        title: '调整后点数',
        minWidth: 130
      },
      {
        field: 'adjustingContent',
        title: '调整内容',
        minWidth: 180
      },
      {
        field: 'estimateIncome',
        title: '预估增加理论收入（万元）',
        minWidth: 160,
        cell: {
          text: {
            type: 'number'
          }
        }
      },
      {
        title: '操作',
        fixed: 'right',
        width: 100,
        align: 'center',
        cell: (item) => {
          let btn = []
          btn.push({
            title: '查看',
            event: 'detail'
          })
          return {
            btn
          }
        }
      }
    ]
  }
}

export default Column
